package com.ruoyi.qywx.entity;

import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.utils.StrUtils;
import com.ruoyi.qywx.model.vo.WelcomeVo;
import lombok.Builder;
import lombok.Data;

import java.util.Date;

/**
 * @author : hcl
 * @Date : 2023/8/28 11:24
 * 全局欢迎语配置 + 欢迎语联合查询
 */
@Data
public class ContactGreetWelcome {
    private Long id;
    private Long teamId;
    private String title;
    private String users;
    private String creator;
    private Date modifyTime;
    //    欢迎语
    private String text;
    private String others;

    public WelcomeVo getWelcome() {
        WelcomeVo vo = new WelcomeVo();
        if (StrUtils.isNotEmpty(others)) {
            vo.setOthers(JSONUtil.parseArray(others));
        }
        vo.setText(text);
        return vo;
    }
}
